The present disclosure is related to Huffman coding.
As is well-known, Huffman codes of a set of symbols are generated based at least in part on the probability of occurrence of source symbols. A binary tree, commonly referred to as a “Huffman Tree” is generated to extract the binary code and the code length. See, for example, D. A. Huffman, “A Method for the Construction of Minimum—Redundancy Codes,” Proceedings of the IRE, Volume 40 No. 9, pages 1098 to 1101, 1952. D. A. Huffman, in the aforementioned paper, describes the process this way:    List all possible symbols with their probabilities;    Find the two symbols with the smallest probabilities;    Replace these by a single set containing both symbols, whose probability is the sum of the individual probabilities;    Repeat until the list contains only one member.This procedure produces a recursively structured set of sets, each of which contains exactly two members. It, therefore, may be represented as a binary tree (“Huffman Tree”) with the symbols as the “leaves.” Then to form the code (“Huffman Code”) for any particular symbol: traverse the binary tree from the root to that symbol, recording “0” for a left branch and “1” for a right branch. One issue, however, for this procedure is that the resultant Huffman tree is not unique. One example of an application of such codes is text compression, such as GZIP. GZIP is a text compression utility, developed under the GNU (Gnu's Not Unix) project, a project with a goal of developing a “free” or freely available UNIX-like operation system, for replacing the “compress” text compression utility on a UNIX operation system. See, for example, Gailly, J. L. and Adler, M., GZIP documentation and sources, available as gzip-1.2.4.tar at the website “http://www.gzip.orh/”. In GZIP, Huffman tree information is passed from the encoder to the decoder in terms of a set of code lengths along with compressed text. Both the encoder and decoder, therefore, generate a unique Huffman code based upon this code-length information. However, generating length information for the Huffman codes by constructing the corresponding Huffman tree is inefficient. In particular, the resulting Huffman codes from the Huffman tree are typically abandoned because the encoder and the decoder will generate the same Huffman codes from the code length information. It would, therefore, be desirable if another approach for generating the code length information were available.